//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef _SDMISC_H_
#define _SDMISC_H_

#include "ddkit.h"
//temp Use............
#ifdef __cplusplus
#define Extern_C extern "C"
#else
#define Extern_C extern
#endif //__cplusplus

//#define DBGOUT(x) x
#define DEBUGCHK(x, y) //{if (!(x)) (y);}
#define DEBUG_CHECK(x, y) DEBUGCHK(x, y)
#define PREFAST_DEBUGCHK(x) assert(NULL != (x))
#define min(x, y) ((x) < (y))? (x) : (y)

Extern_C void ShiftBytes(PByte pbInput, UInt32 cbInput,\
                             UInt32 dwBitOffset, PByte pbOutput);

Extern_C UInt32 GetBitSlice(PUInt8 pBuffer, UInt32 cbBuffer,\
                             UInt32 dwBitOffset, UInt8 ucBitCount);

Extern_C UInt32 GetBitSliceEx( PUInt8 pInBuf, UInt32 cbInBuf, PUInt8 pOutBuf,
                   UInt32 dwBitOffset, UInt8 ucBitCount);

Extern_C void Big2Little(PUInt8 pData, UInt32 length);

Extern_C void hexouts(UInt8* buf, UInt32 buflen);

#endif


